/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.eleric.rememome.db;

import android.database.sqlite.SQLiteDatabase;
import com.eleric.rememome.misc.FieldAndValue;
import com.eleric.rememome.misc.FieldAndValueOperator;
import com.eleric.rememome.type.OrderType;
import java.util.List;

/**
 *
 * @author MWaldman
 */
public interface DbRetriever<T>
{

    public T get(List<FieldAndValueOperator> fieldValueOperList, SQLiteDatabase db);

    public List<T> list(SQLiteDatabase db);

    public List<T> list(OrderType orderType, SQLiteDatabase db);

    public List<T> list(List<FieldAndValueOperator> fieldValueOperList, SQLiteDatabase db);

    public List<T> list(List<FieldAndValueOperator> fieldValueOperList, OrderType orderType,
            SQLiteDatabase db);

    public boolean delete(List<FieldAndValueOperator> fieldValueOperList, SQLiteDatabase db);

    public boolean delete(T t, SQLiteDatabase db);

    public long insert(List<FieldAndValue> fieldValues, SQLiteDatabase db);

    public long insert(T t, SQLiteDatabase db);

    public boolean update(List<FieldAndValue> fieldValueList,
            List<FieldAndValueOperator> fieldValueConditionList, SQLiteDatabase db);

    public boolean update(T t, SQLiteDatabase db);

    public String getTable();

    public String createTableSQL();

    public String[] initializeTableSQL();

    public String[] buildTableRestraintsSQL();

    public String[] removeTableRestraintsSQL();

    public int getVersion();

    public String getKeyField();
}
